const authenticate = () => new Promise<boolean|null>(resolve => {

	plus.fingerprint.authenticate(function () {
		// plus.nativeUI.toast('打卡成功');
		resolve(true);
	}, function (e) {
		switch (e.code) {
			case e.AUTHENTICATE_MISMATCH:
				// logRef.value.log('指纹匹配失败，请重新输入');
				break;
			case e.AUTHENTICATE_OVERLIMIT:
				plus.nativeUI.alert('指纹识别失败次数超出限制，请使用其它方式进行认证');
				resolve(false);
				break;
			case e.CANCEL:
			case e.UNKNOWN_ERROR:
				resolve(null);
				break;
			default:
				resolve(null);
				break;
		}
	});
})
export default authenticate;